#include "playStatusMessage.h"
#include "jsonUtils.h"

PlayStatusMessage::PlayStatusMessage(MtpProtocol* packet) : MtpMessage(packet)
{

}

PlayStatusMessage::PlayStatusMessage(const int64_t& movieId, const int& scene, const int& duration, const int& position, const int& volume)
	: MtpMessage(new MtpProtocol(L"playStatus")),param(movieId,scene,duration,position,volume)
{

}

void PlayStatusMessage::decodeBody()
{
	MtpMessage::decodeBody();
	param.jsonDeserialize(jsonContent);
}

void PlayStatusMessage::encodeBody()
{
	JsonDoc& doc = param.jsonSerialize();
	jsonContent = JsonUtils::jsonStr(doc);
	MtpMessage::encodeBody();
}
